<?php
$data_category = mysql_query("SELECT * FROM category")  or die(mysql_error()); 
$data_item = mysql_query("SELECT item.id, title, content, category, price, image, rating.popularity, rating.rating_max, rating.rating_min  FROM item INNER JOIN rating ON item.id = rating.id LIMIT 0,8")  or die(mysql_error());
$orders = mysql_query("SELECT orders_bets.*, category.name As name  FROM orders_bets LEFT JOIN category ON orders_bets.category = category.id ORDER BY orders_bets.id DESC LIMIT 0,5")  or die(mysql_error());


//--GIGS--
eval ("\$gig_head = \"".gettemplate("gigs/head")."\";");
echo $gig_head;
							
while($item = mysql_fetch_array( $data_item ))
	{
		$desc = cut($item['content'], 90);
		$catname = category($item['category']);
		eval ("\$gig_main = \"".gettemplate("gigs/main")."\";");
		echo $gig_main;
	}
eval ("\$gig_foot = \"".gettemplate("gigs/foot")."\";");
echo $gig_foot;	

	
//--CATEGORY--					
eval ("\$cat_head = \"".gettemplate("category/head")."\";");
echo $cat_head;
				
while($category = mysql_fetch_array( $data_category ))
	{
		eval ("\$cat_main = \"".gettemplate("category/main")."\";");
		echo $cat_main;								
	} 
eval ("\$cat_foot = \"".gettemplate("category/foot")."\";");
echo $cat_foot;	 


	
//--RECENTLY ORDERED
eval ("\$latest_head = \"".gettemplate("recently/head")."\";");
echo $latest_head;
				
while($item = mysql_fetch_array( $orders ))
	{
		$title = cut($item['title'], 40);
		eval ("\$latest_main = \"".gettemplate("recently/main")."\";");
		echo $latest_main;			
	}

eval ("\$latest_foot = \"".gettemplate("recently/foot")."\";");
echo $latest_foot;
?>
			